import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home/home.vue'
import Index from '@/views/Home/index.vue'
import Cla from '@/views/Home/cla.vue'
import Shop from '@/views/Home/shop.vue'
import My from '@/views/Home/my.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // 重定向
    { path: '/', redirect: '/home/index' },
    {
      path: '/home',
      component: Home,
      children: [
        {path: 'index', component: Index},
        {path: 'cla', component: Cla},
        {path: 'shop', component: Shop},
        {path: 'my', component: My},
      ]
    },
  ],
})

export default router
